package cn.edu.lzu.dao;

import cn.edu.lzu.entity.LabItemValue;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * @PackageName: cn.edu.lzu.dao
 * @InterfaceName: LabItemValueMapper
 * @Description: TODO
 * @Author: 张琦[QQ:3098086691]
 * @Date: 2020/4/3 16:31
 * @Version: 1.0
 */
@Mapper
public interface LabItemValueMapper {
    @Insert("insert into lab_item_value (fill_lab_item_id, clause_id, unit_id, is_deleted) values(#{fillLabItemId}, #{clauseId}, #{unitId}, 0)")
    int insAddRecurd(int fillLabItemId, int clauseId, long unitId);

    @Select("select * from lab_item_value where is_deleted=0 and fill_lab_item_id=#{fillLabItemId} and clause_id=#{clauseId} and unit_id=#{unitId}")
    LabItemValue selLabItemValueByPrimary(int fillLabItemId, int clauseId, long unitId);

    @Insert("update lab_item_value set value=#{value} where fill_lab_item_id=#{fillLabItemId} and clause_id=#{clauseId} and unit_id=#{unitId} and is_deleted=0")
    int updAddValue(int fillLabItemId, int clauseId, long unitId, String value);
}
